namespace IOPvsOOP.Math.NOIF
{
    public class FooPoolMath
    {
        private readonly Foo[] foos;
        private int index = -1;

        public FooPoolMath(Foo[] foos)
        {
            this.foos = foos;
        }

        public Foo Get()
        {
            index = (index + 1) % foos.Length;
            return foos[index];
        }
    }
}